package com.syn.phoneface.model.result;

import android.graphics.Bitmap;
import android.graphics.RectF;

import com.smartshino.face.Stfaceattr;

/**
 * <p>
 * Encapsulates the result of decoding a barcode within an image.
 * </p>
 *
 * @author Sean Owen
 */
public class Result {

  private String text;
  private RectF faceRet;
  private long timestamp;
  private Stfaceattr mStfaceattr;
  private String mFeature;
  private Bitmap mBitmap;

  public Result() {}

  public void setBitmap(Bitmap bitmap) {
    mBitmap = bitmap;
  }

  public Bitmap getBitmap() {
    return mBitmap;
  }

  public Result(String text, RectF faceRet) {
    this(text, faceRet, null);
  }

  public Result(String text, RectF faceRet, Stfaceattr stfaceattr) {
    this(text, faceRet, stfaceattr, System.currentTimeMillis());
  }

  public RectF getFaceRet() {
    return faceRet;
  }

  public Result(String text, RectF faceRet, Stfaceattr stfaceattr, long timestamp) {
    this.text = text;
    this.faceRet = faceRet;
    this.timestamp = timestamp;
    this.mStfaceattr = stfaceattr;
  }

  public void setFeature(String feature) {
    mFeature = feature;
  }

  public String getFeature() {
    return mFeature;
  }

  /**
   * @return raw text encoded by the barcode
   */
  public String getText() {
    return text;
  }

  public void setText(String text) {
    this.text = text;
  }

  public long getTimestamp() {
    return timestamp;
  }

  @Override
  public String toString() {
    return text;
  }

  public Stfaceattr getStfaceattr() {
    return mStfaceattr;
  }
}
